package org.paybiz.component.xml.xmlreader;

import java.io.InputStream;

import org.smodel.IXmlModel;
import org.smodel.XmlModelService;


public class XmlTransformer implements IXmlTransformer {

    public String modelToXml(Object obj) throws Exception {
        IXmlModel model = XmlModelService.loadFromBean(obj);
        return XmlModelService.flushToXml(model);
    }

    public Object xmlToModel(InputStream xml, Class<?> objClass) throws Exception {
        IXmlModel model = XmlModelService.loadFromXml(xml);
        return XmlModelService.flushToBean(model, objClass);
    }

}
